package org.example.springbootproject.service;

import org.example.springbootproject.dto.PaperDetailDTO;
import org.example.springbootproject.entity.*;

import java.util.List;
import java.util.Map;

public interface ExamService {

    // ================== 试卷相关 ==================
    List<ExamPaper> getAllPapers();
    ExamPaper getPaperById(Long paperId);
    void createPaper(ExamPaper examPaper);
    void updatePaper(ExamPaper examPaper); // 新增
    void deletePaper(Long id);
    // 查看试卷详情（含题目、选项、每题分值）
    PaperDetailDTO getPaperDetailsWithQuestions(Long paperId);

    // ================== 规则相关 ==================
    List<ExamRule> getAllExamRules();
    void createExamRule(ExamRule examRule);
    ExamRule getExamRuleById(Long ruleId);
    void updateExamRule(ExamRule examRule);
    void deleteExamRule(Long ruleId);

    // ================== 题库相关 ==================
    List<QuestionBank> getAllBanks();
    QuestionBank getBankById(Long bankId);
    void addBank(QuestionBank bank);
    void deleteBank(Long id);
    void updateBank(QuestionBank bank);
    List<QuestionBank> searchBanks(Map<String, String> criteria);

    // ================== 题目相关 ==================
    void updateQuestionCount(Long bankId);
    List<Question> getAllQuestions();
    List<Question> getQuestionsByBankAndType(Long bankId, String type);
    void addQuestion(Question question);
    void deleteQuestion(Long id);
    void updateQuestion(Question question);
    List<Question> searchQuestions(Map<String, String> criteria);

    // ================== 用户管理 ==================
    void updateUser(Long id, User user);
    void deleteUser(Long id);
    User getCurrentUser(String token);
    List<User> getAllUsers();
    Map<String, Object> login(String username, String password, String captcha, String  imgToken, String ip);
    void register(String username, String password, String ip);

}
